﻿using RpcClient.Interface;
using RpcManageClient;
using Wedonek.RpcStore.Service.Interface;
using Wedonek.RpcStore.Service.Model;

namespace Wedonek.RpcStore.Service.LocalEvent.Event
{
        internal class RefreshVerRouteEvent : IEventHandler<RefreshVerRoute>
        {
                private IVerConfigCollect _Ver;
                private IRpcServerCollect _Rpc;
                public RefreshVerRouteEvent (IVerConfigCollect ver, IRpcServerCollect rpc)
                {
                        _Rpc = rpc;
                        _Ver = ver;
                }
                public void HandleEvent (RefreshVerRoute data, string eventName)
                {
                        ServiceVerConfig ver = _Ver.Get (data.VerId);
                        _Rpc.RefreshVerConfig (ver.RpcMerId, ver.SystemTypeId, ver.VerNum);
                }
        }
}
